package com.app.reptile.utils;

import org.htmlunit.NicelyResynchronizingAjaxController;
import org.htmlunit.WebClient;

public class BeanUtils {

    public static WebClient buildWebClient(){
        WebClient webClient = new WebClient();
        webClient.setAjaxController(new NicelyResynchronizingAjaxController());
        webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);
        webClient.getOptions().setThrowExceptionOnScriptError(false);
        webClient.getOptions().setCssEnabled(true);
        webClient.getOptions().setJavaScriptEnabled(true);
        webClient.waitForBackgroundJavaScript(20000);

        return webClient;
    }
}
